<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>定时任务</title>
		<style>
			* {
				margin: 0;
				padding: 0;
			}

			.result {
				margin: 10px 0;
				padding: 20px;
				background: #f2f5f9;
			}

			.btn {
				display: inline-block;
				margin: 10px;
				padding: 10px;
			}
		</style>
	</head>
	<body>
		<div class="result">onlyfileids数据表已经执行清除数据：<span id="num1">0</span>条</div>
		<div class="result">fileids数据表已经执行清除数据：<span id="num2">0</span>条</div>
		<div class="btns">
			<button class="btn" type="button" onclick="clear1()">开始执行清除onlyfileids表数据</button>
			<button class="btn" type="button" onclick="clear2()">开始执行清除fileids表数据</button>
		</div>
		<script src="https://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>
		<script>
			var count1 = 0;
			var count2 = 0;
			// 清除onlyfileids数据
			function clear1() {
				$.ajax({
					url: 'https://bd911ab5-6de1-41ce-a209-88e617ce875d.bspapp.com/clearfileids',
					contentType: 'jsonp',
					success(res) {
						count1 = res.delete_total + count1;
						$('#num1').text(count1);
					},
					complete() {
						setTimeout(() => {
							clear1();
						}, 5000)
					}
				})
			}
			// 清除onlyfileids数据
			function clear2() {
				$.ajax({
					url: 'https://bd911ab5-6de1-41ce-a209-88e617ce875d.bspapp.com/cleardata',
					contentType: 'jsonp',
					success(res) {
						count2 = res.delete_total + count2;
						$('#num2').text(count2);
					},
					complete() {
						setTimeout(() => {
							clear2();
						}, 5000)
					}
				})
			}
		</script>
	</body>
</html>
